package org.jeecg.modules.business.strategy;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.business.entity.BusOrderFee;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Service
public class PricingStrategyFactory {

    @Resource
    public final Map<String,PricingStrategy> strategys = new ConcurrentHashMap<>(5);

    public PricingStrategy getStragegy(String component) throws Exception{
        PricingStrategy strategy = strategys.get(component);
        if(strategy == null){
            throw new RuntimeException("未找到该收费方式");
        }
        return strategy;
    }

}
